unit HeapMonitor;

interface

implementation
uses Sysutils, Windows;

  procedure StartHeapMonitor;
    begin
      OutPutDebugString(PChar('Heap=' + IntToStr(GetHeapStatus.TotalAllocated)));
    end;

  procedure EndHeapMonitor;
    begin
      OutPutDebugString(PChar('Heap=' + IntToStr(GetHeapStatus.TotalAllocated)));
    end;

initialization
  StartHeapMonitor;
finalization
  EndHeapMonitor;
end.
